/*
 * encoder.h
 *
 *  Created on: 12.05.2013
 *      Author: Roma Jam
 */

#ifndef ENCODER_H_
#define ENCODER_H_

#include "kl_lib.h"

#define MEAN_TIME	99

class Encoder_t {
private:
	uint32_t Timer;
	uint32_t *PCnt;
	uint32_t LastCnt;
	bool Changed;
public:
	void Init();
	void Task();
	bool NeedToCheck() 	{ return Changed; }
	uint32_t GetValue() { Changed = false; return *PCnt; }
};

extern Encoder_t Encoder;
#endif /* ENCODER_H_ */
